<!DOCTYPE html>
<html>
<head>
    <title>String Type Manipulation Methods Example</title>
    <script type="text/javascript">
    
        var stringValue = "hello world";
        alert(stringValue.slice(3));        //"lo world"
        alert(stringValue.substring(3));    //"lo world"
        alert(stringValue.substr(3));       //"lo world"
        alert(stringValue.slice(3, 7));     //"lo w"
        alert(stringValue.substring(3,7));  //"lo w"
        alert(stringValue.substr(3, 7));    //"lo worl"
        
        alert(stringValue.slice(-3));         //"rld"
        alert(stringValue.substring(-3));     //"hello world"
        alert(stringValue.substr(-3));        //"rld"
        alert(stringValue.slice(3, -4));      //"lo w"
        alert(stringValue.substring(3, -4));  //"hel"
        alert(stringValue.substr(3, -4));     //"" (empty string)
        
    </script>
</head>
<body>

</body>
</html>